home *** CD-ROM | disk | FTP | other *** search
/ Macworld Expo - Develope…Central & Net Innovations / Developer Central and Net Innovators (MacWorld Expo) (January 1999).iso / Developer Central / Bowers Development / Demo AppMaker / Examples / plain C OS8 / AMReminder / DDocData.c < prev    next >
Encoding:
Text File  |  1998-10-29  |  1.1 KB  |  77 lines  |  [TEXT/CWIE]

  1. // DDocData.cp -- data container class for AMReminder
  2.  
  3. #include "PString.h"
  4. #include "DDocData.h"
  5.  
  6. #include <stdlib.h>
  7.  
  8. //----------
  9. DDocData*        NewDDocData ()
  10. {
  11.     DDocData*        data;
  12.  
  13.     data = (DDocData*)malloc (sizeof (DDocData));
  14.     DDocData_Init (data);
  15.  
  16.     return data;
  17. }
  18.  
  19. //----------
  20. void    DeleteDDocData (
  21.     DDocData*        data)
  22. {
  23.     DDocData_Free (data);
  24.     free (data);
  25. }
  26.  
  27. //----------
  28. void    DDocData_Init (
  29.     DDocData*        self)
  30. {
  31.     AMSignaler_Init ((AMSignaler*) self);
  32.  
  33.     self->mReminderChoice = 0;
  34.     self->mReminders = nil;
  35. }
  36.  
  37. //----------
  38. void    DDocData_Free (
  39.     DDocData*        self)
  40. {
  41.     AMSignaler_Free ((AMSignaler*) self);
  42. }
  43.  
  44. //----------
  45. SInt16        GetReminderChoice (
  46.     DDocData*        self)
  47. {
  48.  
  49.     return self->mReminderChoice;
  50. }
  51.  
  52. void    SetReminderChoice (
  53.     DDocData*        self,
  54.     SInt16        inValue)
  55. {
  56.     self->mReminderChoice = inValue;
  57.     
  58.     SignalDataChanged ((AMSignaler*) self, idReminderChoice);
  59. }
  60.  
  61. //----------
  62. DReminder*        GetReminders (
  63.     DDocData*        self)
  64. {
  65.  
  66.     return self->mReminders;
  67. }
  68.  
  69. void    SetReminders (
  70.     DDocData*        self,
  71.     DReminder*        inValue)
  72. {
  73.     self->mReminders = inValue;
  74.     
  75.     SignalDataChanged ((AMSignaler*) self, idReminders);
  76. }
  77.